/**
 * Copyright (c) 2016-2100 yunclouds
 */
package com.yunqian.redot.domain;

import com.yunqian.model.BaseModel;
import com.yunqian.redot.constant.Tables;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author czy
 * 2018-11-08 09:41:18
 */
@Data
@Entity
@Table(name = Tables.ROLE)
@EqualsAndHashCode(callSuper = false)
public class Role extends BaseModel<Long> {

    /**状态*/
    @Column(name = "status")
    private Integer status = 1;
    /**角色名*/
    @Column(name = "name")
    private String name;
    /**角色名中文*/
    @Column(name = "name_zh")
    private String nameZh;
    /**权限集合*/
    @Column(name = "menu_list")
    private String menuList;


    public Role() {
    }

    public String[] getMenuList() {
        return menuList.substring(1, menuList.length() -1).split(",");
    }
}
